package com.itheima.dao;

import com.itheima.pojo.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.LinkedHashSet;
import java.util.List;

/**
 * @author xiaycbstart
 * @create 2020 01 05 10:49
 */
public interface MenuDao {
    @Select("SELECT m.* FROM t_menu m , t_role_menu rm  WHERE m.id = rm.menu_id  AND rm.role_id = #{roleId} and m.level = 1 order by m.priority ")
    LinkedHashSet<Menu> findMenuListByRoleId(Integer roleId);
    @Select("select * from t_menu m where m.parentMenuId = #{id} order by m.priority ")
    List<Menu> findMenuListByMenuId(Integer id);
}
